package xkp.lesson3;

import xkp.lesson2.UserInfo;
import java.util.HashSet;

public class TestSet {
    public static void main(String[] args) {
        //
        HashSet<UserInfo> userInfoHashSet = new HashSet<>();

        UserInfo userInfo1 = new UserInfo(100,"张三");
        UserInfo userInfo2 = new UserInfo(100,"张三");
        System.out.println(userInfo1.hashCode());
        System.out.println(userInfo2.hashCode());
        userInfoHashSet.add(userInfo1);
        userInfoHashSet.add(userInfo2);
        System.out.println(userInfoHashSet.size());
    }
}
